#pragma once
#ifdef LIN64
  #define DEFAULT_PATH    "/home/plg"
  #define SYS_FONT_PATH   "/usr/share/fonts/truetype"
  #define GRA_FONT_PATH   "/fonts"
#endif

#ifdef ARM32
  #define DEFAULT_PATH    "/home/plg"
  #define SYS_FONT_PATH   "/usr/local/Qt/lib/fonts"
  #define GRA_FONT_PATH   "/home/andreo/qtsdk-2010.05/qtarm472/lib/fonts"
#endif

#ifdef WIN32
  #define DEFAULT_PATH    ""
  #define SYS_FONT_PATH   "C:/Windows/Fonts"
  #define GRA_FONT_PATH   "D:/Projekte/plotter/debug/fn"
#endif
#include <QSettings>

#include "ui_plotter.h"
#include "plt.h"
#include "coutline.h"
#include "stepper.h"
#include "keyboard.h"

#define  STANDBY     0
#define  PLOTTING    1
#define  PAUSE       2
#define  ERROR       3
#define  RPLOTTING   4
#define  CANCELED    5
class MainForm : public QWidget
{
    Q_OBJECT

public:
    MainForm(QWidget *parent = 0);
    ~MainForm();
    void updatePlotter();
    void updateMaterial();
    void updateDatei();
    void log(QString s);
    void reset();
    void move(int x, int y, int z);
    int  speed;
protected:
    bool eventFilter(QObject *obj, QEvent *event);
    void showEvent(QShowEvent * event);

private:
    Ui::HevalPlotter ui;
    QSettings        MySettings;
    int              MyiAppFont;
    QStringList      getFileList(QString path, QString criter);

    // Roh Daten
    QList<QVector3D*> MyFileData;
    qreal             MyFileP;
    QRectF            MyFileRect;

    // CNC Daten
    QList<QVector3D*> MyPlotData;
    QRect             MyDataRect;
    double            MyRelFresTiefe;
    double            MyAbsFresTiefe;
    double            MyRelFahr;
    double            MyAbsFahr;

    QVector3D         MyPlotter;
    QVector3D         MyMaterial;
    QVector3D         MyMotor;

    QVector3D         MyPos;
    int               MyPause;
    int               MyPlotI;
    int               MyDataSize;

  private slots:
    void on_pbExit_clicked();
    void on_cbSpiegelX_clicked();
    void on_cbSpiegelY_clicked();
    void updatePos();
    void on_leCom_returnPressed();
    void on_tbMessMaterialZ_clicked();
    void on_sbMotorX_valueChanged(int );
    void on_sbMotorY_valueChanged(int );
    void on_sbMotorZ_valueChanged(int );
    void on_teFont_textChanged();
    void on_gbDatei_toggled(bool );
    void on_gbText_toggled(bool );
    void on_cbFont_currentIndexChanged(int index);
    void stepperFinished();
    void on_tbMessPlotterZ_clicked();
    void on_pbReset_clicked();
    void on_pbFileAct_clicked();
    void on_tabWidget_currentChanged(int index);
    void on_sbMaterialY_editingFinished();
    void on_sbMaterialX_editingFinished();
    void on_pbPlot_clicked();
    void on_tbLoadFile_clicked();
    void on_pbMoveTo_clicked();
    void on_sbDataH_editingFinished();
    void on_sbDataY_editingFinished();
    void on_sbDataX_editingFinished();
    void on_sbPlotterY_editingFinished();
    void on_sbDataW_editingFinished();
    void on_sbPlotterX_editingFinished();
};

